<!-- {if $member_from eq 'seller'}-->
{include file=member.header.html}
<!--{else}-->
{include file=buyer.header.html}
<!--{/if}-->
<!-- 内容 -->
<div class="content f-cb">
	<!-- 当前位置 -->
	{include file=path.html}
	<!-- 内容左边栏 -->
	<!-- {if $member_from eq 'seller'}-->
	{include file=member.menu.html}
	<!--{else}-->
	{include file=member.menu.buyer.html}
	<!--{/if}-->
	<!-- 内容右边栏 -->
	<div class="con-r-global">
		<div class="gift-header">
			<div class="top"> <b>万菱礼品卡商务馈赠、节日送礼、企业福利的最佳选择。</b>
				超过万种家饰商品的海量选择。
				<a href="{carturl index.php?app=gift_card}" target="_blank" class="linkbtn">立即购买？</a>
			</div>
			<div class="bottom"> <b>如何使用万菱礼品卡？</b>
				<a href="http://www.wljiashi.com/article/129.html" target="_blank" class="linkbtn">查看详情</a>
				<div class="progress"></div>
			</div>
			<div class="tips">
				备注：为保障你的账户资金安全，使用礼品卡余额前必须
				<a href="index.php?app=account_security&act=authen_verify&mode=set_pay_password&from=buyer" target="_blank">设置支付密码</a>
				。
			</div>
		</div>
		<div class="gift-body-wrap">
			<div class="gift-body">
				<div class="top">
					<b>激活礼品卡，充值到账户</b>
				</div>
				<div class="bottom">
					<div id="info" class="info"></div>
					<form action="" method="post" id="gift_frm">
						<table width="100%">
							<tr>
								<td width="80" height="50">请输入卡号：</td>
								<td>
									<input type="text" name="card_number" class="txt" maxlength="12" id="card_number" />
									<span style="margin-left:10px;color:red;">卡号为12位，由数字组成</span>
								</td>
							</tr>
							<tr>
								<td height="50">请输入密码：</td>
								<td>
									<input type="text" name="card_psw" maxlength="16" class="txt" id="card_psw" />
									<span style="margin-left:10px;color:red;">密码为16位，由大写字母、数字1~9（不含0）组成</span>
								</td>
							</tr>
							<tr>
								<td height="60">&nbsp;</td>
								<td>
									<input type="submit" id="submit" class="subbtnhsb" value="确认激活" />
									<input type="reset" class="subbtnhsb grey ml10" value="取消" />
								</td>
							</tr>
							<!-- <tr>
								<td>&nbsp;</td>
								<td align="center"><img src="{res file=images/gift_card/gift_notification.jpg}" width="300" /></td>
							</tr> -->
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$('#gift_frm').validate({
			errorPlacement: function(error, element) {
		      	element.after(error);
		      },
		       submitHandler:function(form){
		          var card_number=$('#card_number').val(),
		                card_psw=$('#card_psw').val(),
		                info=$('#info');
		            $.ajax({
		              type: "POST",
		              url: "index.php?app=paycenter&act=recharge_card_submit",
		              data: {'card_number':card_number,'card_psw':card_psw},
		              dataType: "json",
		              success:function(jdata){
		                if(!jdata.done){ 
		                	info.html(jdata.msg);
		                  setTimeout(function(){
		                    	info.html('');
		                  },8000);
		                }else{
                            window.location.href="index.php?app=paycenter&act=recharge_card&succeed=1&card="+card_number;
                        }
		              }
		            });
		       } ,
			rules: {
				card_number:{
					required:true,
					digits:true
				},
				card_psw:{
					required:true
				}
			},
			messages: {
				card_number:{
					required:'卡号不能为空',
					digits:'卡号格式错误'
				},
				card_psw:{
					required:'卡密码不能为空'
				}
			}
		});
	});
	</script>
<!-- 页脚 -->
{include file=footer.html}